<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <body>
        <ui:composition template="./../template.xhtml">
            <ui:define name="title">
                Detail's Event
            </ui:define>

            <ui:define name="content">
                <h:form>
                    <h2 class="art-postheader">Event's Details ....
                    </h2>
                    <p:messages />
                    <center>
                        <p:panelGrid>
                            <p:row>
                                <p:column rowspan="5"><p:graphicImage value="/resources/css/images/#{eventController.selected.imageEvent}" height="200" width="150"/></p:column>
                            </p:row>
                            <p:row>
                                <p:column colspan="2"><h3 class="art-postheader"> <p align="right"> <h:outputText value="#{eventController.selected.eventName}" style="font-weight: bolder;"/></p></h3></p:column>
                            </p:row>
                            <p:row>
                                <p:column colspan="2">
                                    <h4 class="art-postheader">
                                        <p align="right">
                                            <h:outputText value="#{eventController.selected.eventTitle}" style="font-weight: bold;word-break:break-all;" />
                                        </p>
                                    </h4>

                                    <h5>
                                        <h:outputText value="#{eventController.selected.descriptionEvent}" style="word-break:break-all;" />
                                       
                                    </h5>

                                </p:column>
                            </p:row>
                            <p:row>
                                <p:column>
                                    <h4 class="art-postheader">
                                        Start Event :<h:outputText value="#{eventController.selected.startEvent}" styleClass="art-blockcontent-body">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />

                                        </h:outputText>
                                    </h4>

                                </p:column>
                                <p:column>
                                    <h4 class="art-postheader">
                                        End Event :  <h:outputText value="#{eventController.selected.finishEvent}" styleClass="art-blockcontent-body">
                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                        </h:outputText>
                                    </h4>
                                </p:column>
                            </p:row>
                            <p:row>
                                <p:column colspan="2">
                                    <c:if test="${user == null}">
                                        <p:commandButton icon="ui-icon-arrowrefresh-1-w" action="ViewListEvent" value="Back Event" ajax="false"/>
                                    </c:if>
                                    <c:if test="${user != null}">
                                        <c:set value="#{user.isAdmin}" var="role"/>
                                        <c:if test="${role == true}">
                                            <p:commandButton image="ui-icon ui-icon-pencil" action="#{eventController.prepareEditInView}" value="Edit" ajax="false"/>
                                            <p:commandButton icon="ui-icon-arrowrefresh-1-w" action="ViewListEvent" value="Back Event" ajax="false"/>
                                        </c:if>
                                        <c:if test="${role == false}">
                                            <p:commandButton image="ui-icon ui-icon-check" action="#{registrationController.TakeInViewPage(eventController.selected)}"
                                                             title="TakeIn" ajax="false" value="Participate"
                                                             rendered="#{registrationController.checkTakeIn(eventController.selected) and !eventController.selected.endReg.before(registrationController.today)}"/>

                                            <p:commandButton icon="ui-icon-arrowrefresh-1-w" action="ViewListEvent" value="Back Event" ajax="false"/>
                                        </c:if>
                                    </c:if>

                                </p:column>
                            </p:row>

                        </p:panelGrid>
                    </center>

                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
